package com.hdax.dm.listener;

import com.hdax.dm.feign.order.DmOrderFeign;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@RabbitListener(queues = "order_add_exp")
@Component
public class OrderRollback {

    @Autowired
    private DmOrderFeign orderFeign;


    @RabbitHandler
    public void rollBack(String orderNo){
        orderFeign.deleteOrder(orderNo);
    }
}
